<?php
session_start(); 
/*................................................................ 
 .  [E路联盟系统]                                          .
 .  版本: 2006A1.0                                                  . 
 .  原作: isrn (isrn@qq.com)                             .
 .  支持: http://www.16lm.com        .
................................................................*/
error_reporting(7);
require_once '../../includes/global.php';
require_once '../../includes/function/infofunction.php';
$wcfg=Dga('wcfg',"web like '".$sitename."' and lg like '".$_SESSION[LG]."'");
$wcfg=json_decode($wcfg[wcfg],true);

$webconfig[lgconfig]=$wcfg['lang'];
//print_r($_GET[lg]);

$lglist=Bcc('lg[]',array_keys($wcfg['lang']),$wcfg['lang'],$_GET['lg']);
$ttt->assign('lglist',$lglist);


$sinfo=Dga('infosort',"id='".$_GET[sortid]."'");
//Get table'name;
if($sinfo[tname]!=''){
$tname=$sinfo[tname];
}else{
$tname='info';
}
//echo $tname;
$sinfo[cs]=unserialize($sinfo[cs]);
$sinfo[ct]=unserialize($sinfo[ct]);
$sinfo[cu]=unserialize($sinfo[cu]);
$sinfo[cv]=unserialize($sinfo[cv]);

$zd="abcdefghijklmnopqrstuvwxyz";
$xstitle=array();
$xszz=array();		
$yxtitle=array();
$yxzz=array();
$zyzd=array();		
$ubbzd=array();
$innerbdzd=array();
$filezd=array();
$fujiazd=0;
$sslist='';
$action1='';
$condition1='';
		for($ii=0;$ii<26;$ii++)
		{ 
		
			$uu=substr($zd,$ii,1);
			$sinfo[$uu]=unserialize($sinfo[$uu]);
			if($sinfo[$uu][title]!=''){
			if($sinfo[$uu][ss]==1){
			$sslist.="&nbsp ".$sinfo[$uu][title].":<input type='text' name='".$uu."'>";
			
			$action1.="&".$uu."=".$_GET[$uu];
			$condition1.=" and  ".$uu." like '%".$_GET[$uu]."%'";

			}
			if($sinfo[$uu][xs]=='1'){
				$xstitle[]=$sinfo[$uu][title];
				$xszz[]=$uu;		
			}elseif ($sinfo[$uu][xs]=='0'){
				$yxtitle[]=$sinfo[$uu][title];
				$yxzz[]=$uu;		
			
			}
			}
		}
		for($ii=0;$ii<26;$ii++)
		{ 
			$uu=substr($zd,$ii,1);
			$sinfo['a'.$uu]=unserialize($sinfo['a'.$uu]);
			if($sinfo['a'.$uu][title]!=''){
			if($sinfo['a'.$uu][ss]=='1'){
					if($ii<13){
					$temp=explode('#',$sinfo['a'.$uu][value]);
					foreach($temp as $value)
					{
					    $ttemp=explode('-',$value);
						$yarray[]=$ttemp[0];
						$xarray[$ttemp[0]]=$ttemp[1];
					}
			$sslist.="&nbsp ".$sinfo['a'.$uu][title].":";	
	$sslist.=Bcr('a'.$uu,$yarray,$xarray,$sinfo['a'.$uu][dvalue]);
		if($_GET['a'.$uu]!=''){
			$sinfo['a'.$uu][dvalue]=$_GET['a'.$uu];
			}
				$action1.="&a".$uu."=".$_GET['a'.$uu];
			$condition1.=" and  a".$uu." like '".$sinfo['a'.$uu][dvalue]."'";

					}
					else{
					$yarray=array();
					$xarray=array();
					$temp=explode('#',$sinfo['a'.$uu][value]);
					foreach($temp as $value)
					{
					    $ttemp=explode('-',$value);
						$yarray[]=$ttemp[0];
						$xarray[$ttemp[0]]=$ttemp[1];
					}
			$sslist.="&nbsp ".$sinfo['a'.$uu][title].":";		
			$sslist.=Bcc('a'.$uu.'[]',$yarray,$xarray,$sinfo['a'.$uu][dvalue]);
			if($_GET['a'.$uu]!=''){
			$sinfo['a'.$uu][dvalue]=implode('#',$_GET['a'.$uu]);
			}
			$action1.="&a".$uu."=".$_GET['a'.$uu];
			$condition1.=" and  a".$uu." like '".$sinfo['a'.$uu][dvalue]."'";

					}
				
			
			}
			if($sinfo['a'.$uu][xs]=='1'){
				$xstitle[]=$sinfo['a'.$uu][title];
				$xszz[]='a'.$uu;
				$zyzd[]='a'.$uu;
			}elseif ($sinfo['a'.$uu][xs]=='0'){
				$yxtitle[]=$sinfo['a'.$uu][title];
				$zyzd[]='a'.$uu;	
			}
			}
		}
		for($ii=0;$ii<10;$ii++)
		{ 
			$uu=substr($zd,$ii,1);
			$sinfo['b'.$uu]=unserialize($sinfo['b'.$uu]);
			if($sinfo['b'.$uu][title]!=''){
						if($sinfo['b'.$uu][ss]=='1'){
				$yarray=array();
				$xarray=array();
				$temp=explode('#',$sinfo['b'.$uu][value]);
						foreach($temp as $value)
						{
							$ttemp=explode('-',$value);
							$yarray[]=$ttemp[0];
							$xarray[]=$ttemp[1];
						}
			$sslist.="&nbsp ".$sinfo['b'.$uu][title].":";		
			$sslist.=Bcs('b'.$uu,$yarray,$xarray,$sinfo['b'.$uu][dvalue]);
					if($_GET['b'.$uu]!=''){
			$sinfo['b'.$uu][dvalue]=$_GET['b'.$uu];
			}
				$action1.="&b".$uu."=".$_GET['b'.$uu];
			$condition1.=" and  b".$uu." like '".$sinfo['b'.$uu][dvalue]."'";

			}

			if($sinfo['b'.$uu][xs]=='1'){
				$xstitle[]=$sinfo['b'.$uu][title];
				$xszz[]='b'.$uu;	
				$zyzd[]='b'.$uu;	
			}elseif ($sinfo['b'.$uu][xs]=='0'){
				$yxtitle[]=$sinfo[$uu][title];
				$yxzz[]=$uu;		
				}
				}
		}
		for($ii=10;$ii<26;$ii++)
		{ 
			$uu=substr($zd,$ii,1);
			$sinfo['b'.$uu]=unserialize($sinfo['b'.$uu]);
			if($sinfo['b'.$uu][title]!=''){
				$fujiazd=1;	
				$ubbzd[]='a'.$uu;
			}
		}
		for($ii=0;$ii<13;$ii++)
		{ 
			$uu=substr($zd,$ii,1);
			$sinfo['c'.$uu]=unserialize($sinfo['c'.$uu]);
			if($sinfo['c'.$uu][title]!=''){
				$fujiazd=1;	
				$innerbdtitle[]=$sinfo['c'.$uu][title];
				$innerbdzd[]=$sinfo['c'.$uu][value];
			}
		}
		$ttt->assign('fujiazd',$fujiazd);
		$ttt->assign('innerbdzd',$innerbdzd);
		$ttt->assign('innerbdtitle',$innerbdtitle);
		$ttt->assign('sslist',$sslist);
		 $insort=array('66','67','68','69','70','71','85');
		   if(in_Array($sinfo[id],$insort)) {
			 $sortflag=1;
		   }
		   else{
				$sortflag=0;
		   }
$ttt->assign('sinfo',$sinfo);
$ttt->assign('sortflag',$sortflag);


$ttt->assign('xstitle',$xstitle);
$ttt->assign('xszz',$xszz);
$ttt->assign('yxtitle',$yxtitle);
$ttt->assign('yxzz',$yxzz);



if(!isset($_GET[page])){
$_GET[page]=1;
}
if(isset($_POST[page])){
$_GET[page]=$_POST[page];
}
$ttt->assign('sortid',$_GET[sortid]);
// 多语言搜索
if($_GET[lg]!=''){
	foreach($_GET[lg] as $tlg){
		$sstr.=",'".$tlg."'";
	$action1.="&lg[]=".$tlg;
	}
	$condition1.=" and lg in ('0'".$sstr.")";
}

$action="op=list&sortid=".$_GET[sortid]."&title=".$_GET[title].$action1;

if($sinfo[dtitle]=='1'){
$subcondition.= " and   title like '%".$_GET[title]."%' ";
}

$condition=" and  sortid ='".$_GET[sortid]."'  ".$subcondition." ".$condition1;
//ce($condition);
	if($_GET[bdsortid]!=''&&$_GET[bdid]!='')
	{
	$ttt->assign('bdsortid',$_GET[bdsortid]);
	$ttt->assign('bdid',$_GET[bdid]);
	$ttt->assign('links',"&bdsortid=".$_GET[bdsortid]."&bdid=".$_GET[bdid]);
	$condition=" and  bdid ='".$_GET[bdid]."'  and  bdsortid ='".$_GET[bdsortid]."' ".$condition;
	$action.="&bdsortid=".$_GET[bdsortid]."&bdid=".$_GET[bdid];
	}
	if($_GET[shstatus]!='')
	{
	$condition=" and  shstatus ='".$_GET[shstatus]."'  ".$condition;
	$action.="&shstatus=".$_GET[shstatus];
	}
	
	
$sql="select count(id) as num from ".$prefix."_".$tname." where 1  and del != 1  ".$condition." ;";
	
//echo $sql;
$res=mysql_query($sql);
$temp=mysql_fetch_array($res);
//nav	echo $temp['num'];
$pageline=16;$n=5;$type=2;
$pagelist=$_GET[page].",".$n.",".$pageline.",".$temp['num'].",'".$action."',".$type;

shownav($pagelist,"nav");

$temp=Dgs($tname," 1  and del != 1   ".$condition."  LIMIT ".($_GET[page]-1)*$pageline." , ".$pageline."");

foreach($temp as $key => $value){
		for($ii=0;$ii<13;$ii++){ 
			$uu=substr($zd,$ii,1);
			$temp[$key]['a'.$uu]=unvar($temp[$key][sortid],'a'.$uu,$temp[$key]['a'.$uu]);
			}
		
		for($ii=13;$ii<26;$ii++){
			$uu=substr($zd,$ii,1);
			//ce( $temp[$key]['a'.$uu]);
			$sadfa=uncheckbox($temp[$key][sortid],'a'.$uu,$temp[$key]['a'.$uu]);
			
			$temp[$key]['a'.$uu]=implode('#',$sadfa);
			}
		
			for($ii=0;$ii<10;$ii++)
			{ 
			$uu=substr($zd,$ii,1);
			$temp[$key]['b'.$uu]=unvar($temp[$key][sortid],'b'.$uu,$temp[$key]['b'.$uu]);
			}
}



$ttt->assign('content',$temp);

Ts("info/infolist.htm");


?>